package com.ayz.gateway.core.context.defaults;


import com.ayz.gateway.core.context.config.Configuration;
import com.ayz.gateway.core.context.context.ApiGatewayContext;
import com.ayz.gateway.core.context.context.ApiGatewayContextFactory;
import com.ayz.gateway.core.core.Netty.NettyServerConfig;
import com.ayz.gateway.core.datasource.DatasourceFactory;
import com.ayz.gateway.core.session.processor.RpcPostProcessorRegistry;

/**
 * @ClassName DefaultApiGatewayContextFactory
 * @Description TODO: 默认的ApiGatewayContext创建工厂
 * @Author 快乐的星球
 * @Date 2023/5/7 12:10
 * @Version 1.0
 **/
public class DefaultApiGatewayContextFactory implements ApiGatewayContextFactory {
    @Override
    public ApiGatewayContext openContext(Configuration configuration, NettyServerConfig serverConfig, DatasourceFactory datasourceFactory,
                                         RpcPostProcessorRegistry postProcessorRegistry) {
        return new ApiGatewayContext(configuration,serverConfig,datasourceFactory,postProcessorRegistry);
    }
}
